#include "BaseMenu.h"
//#include <boost\shared_ptr.hpp>
//#include <boost\smart_ptr.hpp>
//#include <boost\weak_ptr.hpp>
//#include <boost\interprocess\smart_ptr\unique_ptr.hpp>

//using boost::shared_ptr;



BaseMenu::BaseMenu(void)
{
    
    //shared_ptr<int> b;
    //b.reset(new int(5));

    //shared_ptr<int> b2 = b;

    //shared_ptr<int> b3 = b2;

    //shared_ptr<int> b4 = b;
    //    
    //b4.reset();
    //
    //bool test1 = b4; // false
    //bool test2 = b3; // true
    //bool test3 = b2; // true
    //bool test4 = b;  // true
}

BaseMenu::~BaseMenu(void) 
{

}

Button* BaseMenu::CreateButton( string caption, int n )
{
    Button* btn = new Button(caption, 0, 0);        
    int centerX = dbScreenWidth()*0.5f - btn->GetWidth()/2;
    float BTN_SPACE = btn->GetHeight();
    int centerY = dbScreenHeight()*0.33f + (btn->GetHeight()/2 + BTN_SPACE)*n;
    btn->SetPosition(centerX, centerY);
    GameEngine::AddObject(btn);
    return btn;
}

TextBox* BaseMenu::CreateTextBox(string text, int n )
{    
    TextBox* txt = new TextBox(0, 0, 130);        
    txt->SetText(text);
    int centerX = dbScreenWidth()*0.5f - txt->GetWidth()/2;
    float TXT_SPACE = txt->GetHeight();
    int centerY = dbScreenHeight()*0.33f + (txt->GetHeight()/2 + TXT_SPACE)*n;
    txt->SetPosition(centerX, centerY);
    GameEngine::AddObject(txt);
    return txt;
}

void BaseMenu::Initialize()
{    
    if (FALSE == dynamic_cast<SpaceBack*>(GameEngine::GetBackground()))
    {
        GameEngine::SetBackground(new SpaceBack());
    }            
}

void BaseMenu::Deinitialize()
{
            
}
